<template>
  <div class="patient-info" v-if="true">
    <div class="patient-info-inside">
      <div class="header">
        <div class="left item">
          <img alt="左侧" src="@/components/assets/images/design/1-12.webp" />
        </div>
        <div class="middle item">选择支付方式</div>
        <div class="right item">
          <img alt="右侧" src="@/components/assets/images/design/1-12.webp" />
        </div>
      </div>
      <el-row class="patient-info-area">
        <el-col :span="24">
          <div class="sign">个人支付：</div>
          <div class="content">{{ patientInfo?.result?.sex }}</div>
        </el-col>
        <el-col :span="24">
          <div class="sign">医保报销：</div>
          <div class="content">{{ patientInfo?.result?.birthday }}</div>
        </el-col>
        <el-col :span="24">
          <div class="sign coloRed">总计金额：</div>
          <div class="content coloRed">{{ patientInfo?.result?.phone }}</div>
        </el-col>
        <el-col :span="24" class="last">
          <div class="item" @click="setTradeMode('WX')">
            <img
              alt="右侧"
              src="@/components/assets/images/design/1-48x1.png"
            />
            微信支付
          </div>
          <div class="item" @click="setTradeMode('ZFB')">
            <img
              alt="右侧"
              src="@/components/assets/images/design/1-48x2.png"
            />
            支付宝支付
          </div>
          <!-- <div class="item" @click="setTradeMode('DB')">
            <img
              alt="右侧"
              src="@/components/assets/images/design/1-48x3.png"
            />
            人脸支付
          </div> -->
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { AndroidToWeb, buildParentApi } from "@/utils/designer/util";
let buildParent = buildParentApi();
export default {
  name: "SelectPaymentMethod",

  componentName: "SelectPaymentMethod",

  components: {},

  data() {
    return {
    };
  },

  computed: {
    patientInfo() {
      return this.$store.getters["DRCbiz/getPatientInfo"];
    },
    tWaitPaythefees() {
      return this.$store.getters["DRCbiz/getWaitPaythefees"];
    },
  },

  mounted() {},

  methods: {
    //  <Request>
    //   <deviceIp>172.17.43.202</deviceIp>
    //   <flowId>JWS30320250206081352328</flowId>
    //   <terminalNo>JWS303</terminalNo>
    //   <method>opPay</method>
    //   <patientId>3524857</patientId>
    //   <cardNo>{"code":0,"data":{"authNo":"ano3918319059111654401330000","bindAuthCode":null,"birthday":null,"chnlId":null,"defPayChnlId":null,"ecIndexNo":"BC77857304F694912BD4132266256B8E","ecQrCode":null,"ecToken":"330000fecc9ohu4ovv158fab0a0000e4246565","email":null,"gender":null,"idNo":"33048319961120162X","idType":"01","insuOrg":"330483","latlnt":null,"nationality":null,"showCodeType":null,"signCntrNo":null,"signFlag":null,"userName":"闻妙敏"},"message":"成功","orgId":"H33048300173"}</cardNo>
    //   <cardType>29</cardType>
    //   <billNo>032920167,032920176,032920177,032920178,032920179,032920180,032920181,032920182,032920234,032920235,032920236</billNo>
    //   <allSelf>1</allSelf>
    //   <tradeMode>CA</tradeMode>
    //   <ybCardNo>33048319961120162X</ybCardNo>
    //   <preYbinfo />
    //   <billItems />
    //   <accountNo />
    //   <cash>0</cash>
    //   <ybTradeType />
    //   <isZj />
    //   <insurFeeInfo>{"setlinfo":{"setl_time":"","cvlserv_pay":0,"hifdm_pay":0,"cvlserv_flag":"0","med_type":"11","exp_content":"","brdy":"1996-11-20","naty":"01","psn_cash_pay":0.0,"certno":"33048319961120162X","hifmi_pay":0,"psn_no":"33048399000000000002471865","act_pay_dedc":0,"mdtrt_cert_type":"01","balc":288.48,"medins_setl_id":"H33048300173202502060815172874","psn_cert_type":"01","acct_mulaid_pay":0,"clr_way":"","hifob_pay":0,"oth_pay":0.0,"medfee_sumamt":275.42,"hifes_pay":0,"gend":"2","mdtrt_id":"330000173880091596804268741489","acct_pay":90.33,"fund_pay_sumamt":185.09,"fulamt_ownpay_amt":5.0,"hosp_part_amt":0,"setl_id":"","inscp_scp_amt":264.42,"insutype":"310","maf_pay":0,"psn_name":"闻妙敏","psn_part_amt":90.33,"clr_optins":"","pool_prop_selfpay":0.7,"psn_type":"1101","hifp_pay":185.09,"overlmt_selfpay":0,"preselfpay_amt":6.0,"age":28.0,"clr_type":"11"},"setldetail":[{"fund_pay_type":"310100","fund_payamt":185.09,"setl_proc_info":"","crt_payb_lmt_amt":0,"inscp_scp_amt":0,"fund_pay_type_name":"城镇职工基本医疗保险统筹基金"},{"fund_pay_type":"310200","fund_payamt":90.33,"setl_proc_info":"","crt_payb_lmt_amt":0,"inscp_scp_amt":0,"fund_pay_type_name":"城镇职工基本医疗保险个人账户基金"}]}</insurFeeInfo>
    //   <insurFee>27542</insurFee>
    //   <cardHardInfo>{"code":0,"data":{"authNo":"ano3918319059111654401330000","bindAuthCode":null,"birthday":null,"chnlId":null,"defPayChnlId":null,"ecIndexNo":"BC77857304F694912BD4132266256B8E","ecQrCode":null,"ecToken":"330000fecc9ohu4ovv158fab0a0000e4246565","email":null,"gender":null,"idNo":"33048319961120162X","idType":"01","insuOrg":"330483","latlnt":null,"nationality":null,"showCodeType":null,"signCntrNo":null,"signFlag":null,"userName":"闻妙敏"},"message":"成功","orgId":"H33048300173"}</cardHardInfo>
    //   <siPatientInfo />
    //   <transNo />
    //   <ybOderNo />
    //   <ybTransType />
    //   <Qrcode />
    //   <receiptNo>ZS001984439</receiptNo>
    //   <outTradeNo />
    //   <extend>{"setlinfo":{"setl_time":"","cvlserv_pay":0,"hifdm_pay":0,"cvlserv_flag":"0","med_type":"11","exp_content":"","brdy":"1996-11-20","naty":"01","psn_cash_pay":0.0,"certno":"33048319961120162X","hifmi_pay":0,"psn_no":"33048399000000000002471865","act_pay_dedc":0,"mdtrt_cert_type":"01","balc":288.48,"medins_setl_id":"H33048300173202502060815172874","psn_cert_type":"01","acct_mulaid_pay":0,"clr_way":"","hifob_pay":0,"oth_pay":0.0,"medfee_sumamt":275.42,"hifes_pay":0,"gend":"2","mdtrt_id":"330000173880091596804268741489","acct_pay":90.33,"fund_pay_sumamt":185.09,"fulamt_ownpay_amt":5.0,"hosp_part_amt":0,"setl_id":"","inscp_scp_amt":264.42,"insutype":"310","maf_pay":0,"psn_name":"闻妙敏","psn_part_amt":90.33,"clr_optins":"","pool_prop_selfpay":0.7,"psn_type":"1101","hifp_pay":185.09,"overlmt_selfpay":0,"preselfpay_amt":6.0,"age":28.0,"clr_type":"11"},"setldetail":[{"fund_pay_type":"310100","fund_payamt":185.09,"setl_proc_info":"","crt_payb_lmt_amt":0,"inscp_scp_amt":0,"fund_pay_type_name":"城镇职工基本医疗保险统筹基金"},{"fund_pay_type":"310200","fund_payamt":90.33,"setl_proc_info":"","crt_payb_lmt_amt":0,"inscp_scp_amt":0,"fund_pay_type_name":"城镇职工基本医疗保险个人账户基金"}]}</extend>
    // </Request>
    setTradeMode(value){
      const { patientId,cardNo,cardType } = this.patientInfo
      const {billNo,} = this.tWaitPaythefees
      let params = {
        Request: {
          deviceIp: "",
          flowId: "",
          terminalNo: "",
          method: "opPay",
          patientId,
          cardNo,
          cardType,
          billNo: '', // 医院待结算单据号
          allSelf: '', //0-医保1-自费结算
          tradeMode: '',  // 银医通账户：OC  银行卡:DB 医保卡：MIC 支付宝:ZFB 微信:WX
          ybCardNo: '', // 医保卡号
          preYbinfo: '', // 医保预结算信息
          billItems: '', // 缴费单据
          accountNo: '', // 交易账户	C	不可空	根据不同支付方式传入如院内账号就是卡号
          cash: '', // 金额	N		总金额
          ybTradeType: '', // 医保待遇类型
          isZj: '',  // 诊间结算  1.诊间 0.非诊间
          insurFeeInfo: '', // 医保支付信息
          insurFee: '', // 医保支付	N	单位为分
          cardHardInfo: '', //ICMW
          siPatientInfo: '', // 医保病信息
          transNo: '', // 扣费的交易流水号	诊间结算传opPayConfirm返回的ＰＯＳ流水号
          ybOderNo: '', // 电子社保卡支付订单号  电子社保卡支付时需要传（preAppointReg交易中有返回）
          ybTransType: '', // 电子社保卡结算类型 1结算（轮询支付结果） 0取消结算
          Qrcode: '',
          receiptNo: '', // 收据号 HIS收费结算唯一号
          outTradeNo: '', // 支付宝,微信交易流水号
          extend: '',
        },
      };
      let paramsInfo = this.$x2js.js2xml(params);
      buildParent.executeParentMethod(
        "axiosRep",
        paramsInfo,
        "opPay"
      );
      // 输出
      // "ResultCode": "0",
      // "ResultData": {
      //   "selfFee": "0",
      //   "insurFee": "6930",
      //   "allFee": "6930",
      //   "receiptNo": "ZS001984836",
      //   "takeMedWin": "西药请到西药房2号窗口取药",
      //   "hasMoreFee": "0",
      //   "oppatNo": "YY0015833",
      //   "deptName": "妇科综合门诊",
      //   "doctName": "刘丽琴",
      //   "infusionFee": "0",
      //   "dzfpcode": "CZ-EI-33,1.0.0,33060125,1244291188,164238,20250206,69.30"
      // }
    },
   
  },
};
</script>

<style scoped lang="scss">
@import "./assets/style";
</style>